-
-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Legacy android port #1530
base: master
Are you sure you want to change the base?
Legacy android port #1530
Conversation
After a quick look, I don't have any objections. Will look further a bit later. |
File server with this issues:
Deleting files implemented, but does not work for some reason
Deleting folders unimplemented.
File server TODO:
check zip download/upload on real devices
Uploading folders seems to work ok and very fast, but listing files slow. Why?
Recent build (not published one) have strange regression: barney cannot move after c0a0d
Android 12 issues:
1. Fileserver does not work (fixed, use accept4 syscall first)
2. GDB does not work (fixed, rebuild with musl)
3. Back button sometimes closes engine during hiding console. This seems not reproduce on android 8, but very similar to issues on early new engine port. Maybe device-specific issue?
4. Sometimes getting SIGABRT on exit. It seems to be after exit() or device-specific, but need debug
Still missing:
1. Mod support. I not very interested in ndk20x abi due to platform19 requirement and port not fully compatible with any mods. aarch64 version should be compatible with new mod abi, but armeabi-v7a uses old abi with different file names, so it compatible with nothing
2. Create shortcut feature is ugly and does not support new launchers/android itself
3. Cannot close console when virtual keybpard active
4. CI/testing/update channels?
5. Version information should be collected fromall projects
6. Localization for new features
7 New launcher interface? There are two ideas: mod list in the launcher and calling laucher from mod with extra data
8. Installation instructions for internal folder
|
if( si->nbucket == 0 ) | ||
return NULL; | ||
|
||
for(int j = 0; j < si->nbucket; j++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing code block and indentation.
|
||
extern "C" int __attribute__((visibility("hidden"))) dladdr( const void *addr, Dl_info *info ) | ||
{ | ||
static int (*pDladdr)( const void *addr, Dl_info *info ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this a bit more readable and beautiful:
typedef int (*PFNDLADDR)( const void *addr, Dl_info *info );
PFNDLADDR pfn_dladdr;
if( !pfn_dladdr )
{
<-->void *lib = dlopen( "libdl.so", RTLD_NOW );
<-->if( lib )
<--><-->pfn_dladdr = (PFNDLADDR)dlsym( lib, "dladdr" );
<-->if( pfn_dladdr == (PFNDLADDR)dladdr )
<--><-->pfn_dladdr = 0;
<-->if( !pfn_dladdr )
<--><-->pfn_dladdr = (PFNDLADDR)dladdr_fallback;
}
return pfn_dladdr( addr, info );
Also, do you really need to dlopen
libdl.so here? Wouldn't dlsym( RTLD_NEXT, ...
be sufficient?
return NULL; | ||
|
||
for(int j = 0; j < si->nbucket; j++) | ||
for (unsigned n = si->bucket[j]; n != 0; n = si->chain[n]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this file is in C++, why not use auto?
ref/gl/gl_opengl.c
Outdated
@@ -585,6 +589,9 @@ qboolean GL_CheckExtension( const char *name, const dllfunc_t *funcs, const char | |||
if(( f = gEngfuncs.GL_GetProcAddress( name ))) | |||
{ | |||
// GL_GetProcAddress prints errors about missing functions, so tell user that we found it with different name | |||
#ifdef XASH_GLES | |||
if(i != 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so ugly. I don't know what to do about this, but this better be refactored somehow.
ref/gl/gl_sprite.c
Outdated
frametype_t frametype = pframetype->type; | ||
frametype_t frametype; | ||
|
||
memcpy( &dframetype, pframetype, sizeof( dframetype )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really need dframetype
in outer scope?
Maybe its scope could be lowered to this block?
ref/soft/r_sprite.c
Outdated
frametype_t frametype = pframetype->type; | ||
frametype_t frametype; | ||
|
||
memcpy( &dframetype, pframetype, sizeof( dframetype )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as in ref_gl.
@@ -240,9 +241,22 @@ def strip(self): | |||
return os.path.join(self.gen_binutils_path(), 'llvm-strip') | |||
return os.path.join(self.gen_binutils_path(), 'strip') | |||
|
|||
def objcopy(self): | |||
if self.is_host() and not self.ndk_binutils: | |||
environ = getattr(self.ctx, 'environ', os.environ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need getattr
here.
Context already should have environ (we're literally overriding compilers and tools through it)
@@ -102,6 +102,42 @@ REFDLLS = [ | |||
RefDll('gles3compat', False), | |||
] | |||
|
|||
def process_extra_projects_opts(ctx): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO extra projects thing should migrate to waifulib/subproject.py after a while...
Crash report on HTC Desire 610. |
Strange layout inflater bug on HTC. This dialog works OK even on 1.5, 2.3, 4.2, 7.0 and 8.1. I'll include workaround to next build
|
Fixed dlsym-weak codestyle. I not sure using auto in non-deduced type and not before very complex casts is good idea.
RTLD_NEXT does not seems to search library in linker, and it is even unclear for me, what RTLD_NEXT should do in this case. dlopen just returns soinfo stub from linker on android, so it seems to be best solution, in never unloads anyway.
|
} | ||
|
||
extern "C" void* dlsym_weak(void* handle, const char* symbol) { | ||
#include "lib_android.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Includes better be at the start of the file.
Elf_Sym *sym; | ||
|
||
if( !server_info ) | ||
server_info = ( soinfo* )ANDROID_GetServerLibrary(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You called ANDROID_
here when the function is called Android_
.
I think it won't compile.
engine/platform/platform.h
Outdated
// libc builds with -fomit-frame-pointer may just eat stack frame (hello, glibc), making this useless | ||
// calling syscalls directly allows to make break like if it was asm("int $3") on x86 | ||
#ifdef __arm__ | ||
// this multi-line macro hides single line under it, multi-line macro will be expanded to single-line anyway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unuseful comment. Everybody who ever looked into gcc -E
output knows how C preprocessor works.
engine/platform/platform.h
Outdated
"svc 0\n\t" \ | ||
: \ | ||
:"r"(raise_pid), "r"(raise_tid), "r"(raise_sig) \ | ||
: "r0", "r1", "r2", "r7", "memory" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgotten \
at the end of line.
When will you release it officially? |
@amirwolf512lo what do you even mean |
You do not have players statistics |
We know. @amirwolf512lo |
It will be decided after a first truly stable Android release of the new engine. It depends on how soon players and server owners will migrate to the new protocol. I hope for some cooperation in this. |
Anyway, it's not the place to discuss such things. If you want to give your ideas on post-first-Android-stable-release, make a new issue. |
5bbe02d
to
9f4aa27
Compare
…of new port merge" This reverts commit ef663a8.
…lly is an error that should be fixed on Activity side, not here
…for event_set_pause, fix wrong host.status, prevent rendering while no surface
…p using surfaceless mode or dummy surface if possible
…witching to ndk binutils with host clang
… glBindBufferARB somehow\!)
…esktop bits per pixel
…around broken messageBox from crashhandler
…pable flag early as possible
9f4aa27
to
38a3154
Compare
This restores old non-sdl android port
Fix unstable engine in background mode (mostly, TODO: debug some edge cases, gles3compat will crash on any frame without context)
Workaround showing messageboxes on crash (every jni call from handler silently exited process)
Fix host-clang on recent clang versions
Fix android_sleep mode
Refactor jni code, restore egl support (EGL core now can be reused in other platforms, move to separate platform section if needed)
Enabled with --enable-android-legacy option
To build apk, add game code project and xash3d-android-project(android-legacy branch) with --extra-projects option, otherwise only native libraries enabled